﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using dal.emoney;
using System.Collections;
using System.Data;
using DAL;

namespace BLL.emoney
{
    /// <summary>
    ///STOCK_ABNORMALBLL 的摘要说明
    /// </summary>
    public class STOCK_ABNORMALBLL
    {
        public string GetData()
        {
            string key = "BLL.emoney.STOCK_ABNORMALBLL.GetData";
            string str = (string)MemcachedTools.Get(key);
            if (!string.IsNullOrEmpty(str))
            {
                return str;
            }
            STOCK_ABNORMAL dal = new STOCK_ABNORMAL();
            var data= dal.GetData();
            ArrayList lst = new ArrayList();
            CommonBLL cbll = new CommonBLL();
            for (int i = 0; i < data.Rows.Count; i++)
            {
                DataRow row = data.Rows[i];
                string stock_id=Tools.GetString(row["stock_id"]);
                string stock_name=Tools.GetString(row["stock_name"]);
                if (cbll.DicStock.ContainsKey(stock_id))
                {
                    lst.Add(new { stock_id = stock_id, stock_name });
                }
            }
            str = JsonBLL.ToJson(lst);
            MemcachedTools.Add(key, str, DateTime.Now.AddMinutes(30));
            return str;
        }
    }
}